package com.funny.learning.english.customize;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

import com.funny.learning.english.R;

public class RelativeTopicCustomize extends RelativeLayout{

	public RelativeTopicCustomize(Context context) {
		super(context);
//		DisplayMetrics metrics = context.getResources().getDisplayMetrics();
//		width = metrics.widthPixels;
//		this.setScaleType(ScaleType.CENTER_CROP);
	}

	public RelativeTopicCustomize(Context context, AttributeSet attrs) {
		super(context, attrs);
//		DisplayMetrics metrics = context.getResources().getDisplayMetrics();
//		width = metrics.widthPixels;
//		this.setScaleType(ScaleType.CENTER_CROP);
	}
	
	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		
		int heightImage = getContext().getResources().getDimensionPixelSize(R.dimen.height);
		int widthImage = (int) (heightImage * 1.2);
//		Debug.debug("Width Image : " + widthImage);
//		Debug.debug("Width Screen : " + width);
		this.setMeasuredDimension(widthImage, heightImage);
	}

}
